using System;
using System.Collections.Generic;
using LaxCraft.Domain;

namespace LaxCraft.Repositories
{
	using NHibernate;

	using LaxCraft.Plumbing;

	public class LinkRepository : ILinkRepository
	{
		private readonly ISession session;

		public LinkRepository(ISession session)
		{
			this.session = session;
		}

	    public IEnumerable<Link> GetLinks()
	    {
            using (var tx = session.BeginTransaction()) {
                var data = session.QueryOver<Link>().Future();
                tx.Commit();
                return data;
            }
	    }

	}
}